<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateWorkOrderAudit extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        if (Schema::hasTable('work_order_audit')) {
            return;
        }
        Schema::create('work_order_audit', function (Blueprint $table) {
            $table->id();
            $table->unsignedInteger('work_order_id')->default(0)->comment('工单ID');
            $table->text('content')->comment('审核内容');
            $table->unsignedInteger('create_user_id')->default(0)->comment('创建人');
            $table->integer('create_time')->nullable();
            $table->integer('update_time')->nullable();
        });
        Schema::create('work_order_callback', function (Blueprint $table) {
            $table->id();
            $table->unsignedInteger('work_order_id')->default(0)->comment('工单ID');
            $table->text('content')->comment('回访内容');
            $table->unsignedInteger('create_user_id')->default(0)->comment('创建人');
            $table->integer('create_time')->nullable();
            $table->integer('update_time')->nullable();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {

    }
}
